package com.xjh.him.util;

import java.util.Random;

public class RandomUtil {
    private static final Random random = new Random();

    public static String randomIntString(int len) {
        int tl = 6;
        if (len <= tl) {
            throw new IllegalArgumentException("random length must > 6");
        }
        StringBuilder builder = new StringBuilder();
        String curTimeStr = String.valueOf(System.currentTimeMillis());
        builder.append(curTimeStr.substring(curTimeStr.length()-tl));
        for (int i=0; i<len-tl; i++) {
            builder.append(random.nextInt(10));
        }
        return builder.toString();
    }
}
